/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: mirac
 * Date: 2025-07-21
 * Time: 13:44
 */
public class User {
    //用户名和登录密码
    public String name = "abb";
    public String password = "123";
    //登录方法
    public void func(String name,String password) {
        if(!this.name.equals(name)) {
            throw new NameException("用户名异常");
        }
        if(!this.password.equals(password)) {
            throw new PasswordException("密码异常");
        }

        System.out.println("登陆成功");
    }
}
